package com.bwie.unit;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Rabbit {

    @Bean
    public Queue tianjiaQueue(){
        return new Queue("tianjiaQueue",true);
    }

    @Bean
    public FanoutExchange directExchange(){
        return new FanoutExchange("directExchange");
    }

    @Bean
    public Binding addBinding(){
        return BindingBuilder.bind(tianjiaQueue()).to(directExchange());
    }

}
